/**
 * Created by luqidong on 2018/1/12.
 */
import axios from 'axios';
import store2 from 'store2';
import {authorization} from '../uitls/common'
axios.interceptors.response.use(
    response => {
        const {data}=response;
        //未登录
        if([-2, 17031701, 17031702].indexOf(data.code) > -1) {
            store2.clear();
            location.reload();
            // this.$vux.toast.text('登录状态过期即将跳转授权');
            // authorization();
            // setTimeout(()=> {
            //     store2.clear();
            // }, 1000)
        }
        return response;
    },
    error => {

        return Promise.reject(error.response.data);
    });
export default  axios;